package org.changs.game.android.utils;

import com.google.common.eventbus.EventBus;

public class EventBusUtils {

    private static EventBus eventBus;

    private static void init() {
        if (eventBus == null) {
            synchronized (EventBusUtils.class) {
                if (eventBus == null)
                    eventBus = new EventBus("educate");
            }
        }
    }

    public static void register(Object object) {
        init();
        eventBus.register(object);
    }

    public static void unregister(Object object) {
        init();
        eventBus.unregister(object);
    }

    public static void post(Object event) {
        init();
        eventBus.post(event);
    }

}
